<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Flash气泡信息窗体</title>

<script type="text/javascript" src="http://app.mapabc.com/apis?t=flashmap&v=2.4.1&key=b0a7db0b3a30f944a21c3682064dc70ef5b738b062f6479a5eca39725798b1ee300bd8d5de3a4ae3|29e8ed1f7f6a97d8e99fc568cea6a7dc0ccd920856e07c0718b9885faf7551a18141699c81f526d7"></script>

<script type="text/javascript">
var mapObj=null;
function mapInit() {
	var mapoption = new MMapOptions();
	mapoption.toolbar = MConstants.ROUND; //设置地图初始化工具条，ROUND:新版圆工具条
	mapoption.overviewMap = MConstants.SHOW; //设置鹰眼地图的状态，SHOW:显示，HIDE:隐藏（默认）
	mapoption.scale = MConstants.SHOW; //设置地图初始化比例尺状态，SHOW:显示（默认），HIDE:隐藏。
	mapoption.zoom = 13;//要加载的地图的缩放级别
	mapoption.center = new MLngLat(116.397428,39.90923);//要加载的地图的中心点经纬度坐标
	mapoption.language = MConstants.MAP_CN;//设置地图类型，MAP_CN:中文地图（默认），MAP_EN:英文地图
	mapoption.fullScreenButton = MConstants.SHOW;//设置是否显示全屏按钮，SHOW:显示（默认），HIDE:隐藏
	mapoption.centerCross = MConstants.SHOW;//设置是否在地图上显示中心十字,SHOW:显示（默认），HIDE:隐藏
	mapoption.toolbarPos=new MPoint(20,20); //设置工具条在地图上的显示位置
	mapObj = new MMap("map", mapoption); //地图初始化
	mapObj.addEventListener(mapObj,MConstants.ADD_OVERLAY,addOverlayEvent);
}
var tipOption=new MTipOptions();
function addFlashTip(){
	mapObj.removeAllOverlays();
	var fontstyle=new MFontStyle();
	fontstyle.size=14;
	fontstyle.color=0xFF0066;
	fontstyle.bold=false;

	var fontstyle1=new MFontStyle();
	fontstyle1.size=20;
	fontstyle1.color=0xFF0066;//内容字体颜色无效
	fontstyle1.bold=true;

	tipOption.title="信息窗口标题";
	tipOption.titleFontStyle=fontstyle;

	tipOption.content="信息窗口内容";
	tipOption.contentFontStyle=fontstyle1;

	tipOption.roundRectSize=20;//tip矩形圆边长度
	tipOption.tipType=MConstants.FLASH_BUBBLE_TIP;
	tipOption.hasShadow=true;
}
function addMarker(id,l){
	addFlashTip();
	var markerOption = new MMarkerOptions();
	markerOption.imageUrl="http://code.mapabc.com/images/lan_1.png";
	markerOption.picAgent=false;
	markerOption.imageAlign=MConstants.BOTTOM_CENTER;
	markerOption.tipOption = tipOption;
	markerOption.canShowTip= true;
	var marker = new MMarker(new MLngLat("116.40546798706054","39.90776109736608"),markerOption);
	marker.id="marker01";
	mapObj.addOverlay(marker,true) ;
}
function addPolyline(){
	addFlashTip();
	var arr=new Array();
	arr.push(new MLngLat("116.36890411376953","39.913423004886866"));
	arr.push(new MLngLat("116.38212203979492","39.9011768955094"));
	arr.push(new MLngLat("116.38727188110351","39.91250133090293"));
	arr.push(new MLngLat("116.39825820922851","39.904600759441024"));
	var lineopt=new MLineOptions();
	lineopt.tipOption=tipOption;
	lineopt.canShowTip=true;
	var polyline=new MPolyline(arr,lineopt);
	polyline.id="polyline01";
	mapObj.addOverlay(polyline,true);
}
function addPolygon(){
	addFlashTip();
	var arr=new Array();//由多边形顶点组成的经纬度数组
	arr.push(new MLngLat("116.37062072753906","39.8951188709751"));
	arr.push(new MLngLat("116.3862419128418","39.886557705928475"));
	arr.push(new MLngLat("116.3975715637207","39.89419695072923"));
	var areaopt=new MAreaOptions();
	areaopt.canShowTip=true;
	areaopt.tipOption=tipOption;
	var polygon=new MPolygon(arr,areaopt);
	polygon.id="polygon01";
	mapObj.addOverlay(polygon,true);
}
function addMap(){
	addFlashTip();
	mapObj.openTip(new MLngLat("116.39825820922851","39.904600759441024"),tipOption);
}
function addOverlayEvent(param){
	mapObj.openOverlayTip(param.overlayId);
}
</script>
</head>
<body onload="mapInit();">
<div id="map" style="width:500px;height:400px"></div><br />
Flash气泡信息窗体，仅支持点、线、面、地图：<br />
<input type="button" value="点的信息窗体" onclick="addMarker()"><br />
<input type="button" value="线的信息窗体" onclick="addPolyline()"><br />
<input type="button" value="面的信息窗体" onclick="addPolygon()"><br />
<input type="button" value="地图的信息窗体" onclick="addMap()"><br />
<input type="button" value="关闭的信息窗体" onclick="mapObj.closeTip()">
</body>
</html>
